package cn.bgs.service.impl;

import cn.bgs.mapper.FileMapper;
import cn.bgs.pojo.File;
import cn.bgs.service.IFileService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 文件表 服务实现类
 * </p>
 *
 * @author cf
 * @since 2022-06-07
 */
@Service
public class FileServiceImpl extends ServiceImpl<FileMapper, File> implements IFileService {

    @Autowired
    private FileMapper fileMapper;

    @Override
    public void addCarPhoto(Integer vehicleCarId, String fileUrl) {
       int insert = fileMapper.addCarPhoto(vehicleCarId,fileUrl);
       if(insert == 0){
           System.out.println("车身图片添加失败");
       }
    }

    @Override
    public File getCarPhoto(Integer vehicleCarId) {
        return fileMapper.getCarPhoto(vehicleCarId);
    }

    @Override
    public int updCarPhoto(File file) {
        return fileMapper.updCarPhoto(file);
    }
}
